<h1>Listing rights</h1>

<table>
  <tr>
    <th>User</th>
    <th>Self create</th>
    <th>Self approve</th>
    <th>Self edit</th>
    <th>Other create</th>
    <th>Other approve</th>
    <th>Other edit</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @rights.each do |right| %>
  <tr>
    <td><%= User.find(right.user_id).username %></td>
    <td><%  display_true_false_field(right.self_create) %></td>
    <td><%  display_true_false_field(right.self_approve) %></td>
    <td><%  display_true_false_field(right.self_edit) %></td>
    <td><%  display_true_false_field(right.other_create) %></td>
    <td><%  display_true_false_field(right.other_approve) %></td>
    <td><%  display_true_false_field(right.other_edit) %></td>
    <td><%= link_to 'Show', right %></td>
    <td><%= link_to 'Edit', edit_right_path(right) %></td>
    <td><%= link_to 'Destroy', right, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Right', new_right_path %>
